#include<iostream>
#include<signal.h>
#include<unistd.h>
#include<cstring>
void handler(int signo)
{
    std::cout << " signo: " << signo << std::endl;
    sleep(5);
    std::cout << "start" << std::endl;
}
int main()
{
    struct sigaction act;
    memset(&act, 0, sizeof(act));
    sigemptyset(&act.sa_mask);
    sigaddset(&act.sa_mask, 1);
    act.sa_handler = handler;
    sigaction(2, &act, nullptr);
    while(true)
    {
        std::cout << "hello" << std::endl;
        sleep(1);
    }
    return 0;
}